package info.cs52.fes.lp;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhrasePattern {
	private String pattern;
	//to return a text answer: ".*"
	//to catch a number: ".*\\b\\d+\\b.*"
	//to catch a multiple choices: ???
	//to catch yes no: 
	//to else???
	private String[] simplePhrases;
	private int type;
	
	
	public PhrasePattern() {
		super();
	}

	public PhrasePattern(String pattern, String[] simplePhrases, int type) {
		super();
		this.pattern = pattern;
		this.simplePhrases = simplePhrases;
		this.type = type;
	}

	public String getPattern() {
		return pattern;
	}

	public int getType() {
		return type;
	}
	
	public String[] getSimplePhrases() {
		return simplePhrases;
	}

	public void setSimplePhrases(String[] simplePhrases) {
		this.simplePhrases = simplePhrases;
	}

	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

	public void setType(int type) {
		this.type = type;
	}

	public boolean matches(String str){
		Pattern p = Pattern.compile(pattern);
		Matcher m = p.matcher(str);
		return m.matches();
	}
	
}
